We have developed a hierarchical method to compute protein structure from first principles, without use of secondary structure predictions, homology modeling, threading, etc. Its first step is global optimization of a united-residue (UNRES) potential function. From a physical point of view, this is a restricted free energy function, obtained by integrating out the fine-grain or less important degrees of freedom pertaining to the solvent molecules, the side-chain dihedral angles, etc. The ability of this UNRES function to produce ordered structures was achieved by considering multibody or correlation terms which involve more than two interactions sites; these terms arise from the expansion of the restricted free energy function in a cumulant series. We had previously implemented the correlation of backbone electrostatic interactions involving up to two pairs of consecutive peptide groups, as encountered in alpha-helices or beta-sheets. This method fared very well, but not perfectly, in the blind exercise of CASP3. We have now developed analytical expressions for correlation terms up to sixth order, involving local and electrostatic interactions. These terms lead to even better ordering properties, and should, therefore, extend the capability of the force field to compute the beta-structure portion of globular proteins, in addition to our previous capability to predict the alpha-helical portions. The united-residue chain is subsequently converted to an all-atom model that is refined with a potential function optimized by calculations of crystal structures. With the additional correlation terms, we achieved partial success in CASP4. With improvements in the UNRES and all-atom force fields, and in global optimization methods, proposed here in section D, we expect to be able to predict structures of 250-residue proteins with r.m.s.d.'s of 2-3 A, or better, from the experimental structures.